import './index.less';
import { mapState, mapMutations } from 'vuex';
export default {

  computed: {
    ...mapState('fraMonitoring', [
      'activeIndex', // 除了机队状态的table选中
      'faActiveIndex'// 机队状态的table选中
    ])
  },
  methods: {
    ...mapMutations('fraMonitoring', [
      'setState'
    ]),
    // 隔行变色和选中
    rowClassHandler(record, index) {
      let className = ['light-row'];
      if (index % 2 === 1) className = ['light-row'];
      (this.activeIndex[1] || this.activeIndex[0]) === index
        ? className.push('active-row-c')
        : className.push('active-row-n');
      return className;
    },
    rowVxeClassHandler({ rowIndex }) {
      let className = ['light-row'];
      if (rowIndex % 2 === 1) className = ['light-row'];
      (this.activeIndex[1] || this.activeIndex[0]) === rowIndex
        ? className.push('active-row-c')
        : className.push('active-row-n');
      return className;
    },

    // 除了机队状态
    // 隔行变色和选中
    faRowClassHandler(record, index) {
      let className = ['light-row'];
      if (index % 2 === 1) className = ['light-row'];
      (this.faActiveIndex[1] || this.faActiveIndex[0]) === index
        ? className.push('active-row-c')
        : className.push('active-row-n');
      return className;
    }
  }
};
